private _createFile(file: string): Node { var lastSlashPos = file.lastIndexOf('/'); var parentDir = file.slice(1, lastSlashPos);
var fileName = file = file.slice(lastSlashPos + 1);
var parent = this._virtualRoot.findOrCreateDir(parentDir);
var node = parent.createFile(fileName);
return this._virtualRoot.createFile(file.slice(1));
private _onClick(e: MouseEvent) { var node = this._getNode(<any>e.target);
if (node === this._virtualRoot) return;
this._selectFileNode(node);
private _selectFileNode(node: Node) { if (this._selectedFileNode) { this._selectedFileNode.setSelectClass(false);
this._selectedFileNode = node;
this.selectedFile(node.fullPath);
this._selectedFileNode.setSelectClass(true);
private _getNode(elem: HTMLElement): Node { var node = (<any>elem)._teapo_node;
elem = elem.parentElement;
private _contentPRE: HTMLPreElement = null;
private _subDirs: Node[] = [];
private _files: Node[] = [];
private _ul: HTMLUListElement = null;
allFiles: { [file: string]: Node; }) { (<any>li)._teapo_node = this;
var childLIs: HTMLLIElement[] = [];
for (var i = 0; i < this.li.children.length; i++) { var child = this.li.children[i];
if ((<HTMLLIElement>child).tagName === 'LI') childLIs.push(<HTMLLIElement>child);
if ((<HTMLUListElement>child).tagName === 'UL') { this._ul = <HTMLUListElement>child;
for (var j = 0; j < this._ul.children.length; j++) {